using System.ComponentModel.DataAnnotations;

namespace UniversalAdmin.Application.DTOs;

public class CreateUserDto
{
  [Required(ErrorMessage = "用户名不能为空")]
  [StringLength(50, ErrorMessage = "用户名长度不能超过50个字符")]
  public string Username { get; set; } = null!;

  [Required(ErrorMessage = "密码不能为空")]
  [StringLength(100, MinimumLength = 6, ErrorMessage = "密码长度必须在6-100个字符之间")]
  public string Password { get; set; } = null!;

  [Required(ErrorMessage = "邮箱不能为空")]
  [EmailAddress(ErrorMessage = "邮箱格式不正确")]
  public string Email { get; set; } = null!;

  [Phone(ErrorMessage = "手机号格式不正确")]
  public string? Phone { get; set; }

  public string? Avatar { get; set; }

  public bool IsActive { get; set; } = true;

  public List<int> RoleIds { get; set; } = new List<int>();
}